﻿var myModule = angular.module("HelloAngular", []);
myModule.controller("helloAngular", [ '$scope', function angular($scope) {
	$scope.greeting = {
		text : 'hello'
	}
} ])
myModule.controller('ctr1', [ '$scope', function str1($scope, $rootscope) {
	$scope.name = 'word';
} ])

myModule.controller('EventController', [ '$scope',
		function eventController($scope) {
			$scope.count = 0;
			$scope.$on('MyEvent', function() {
				$scope.count++;
			})
		} ])
myModule.controller('ctr2', [ '$scope', function str2($scope) {
	$scope.names = [ '小A', '小B' ];
	$scope.dep = 'Angular'
} ])
myModule.directive("hello", function() {
	return {
		restrict : "E",
		template : '<div>Hi everyone</div>',
		replace : true
	}
})
